function goBack() {
	location.href = "/park/index";
}
var _data = [];
function _go(_e) {
	var id = $(_e).attr('id');
	var _detail = _data[parseInt(id)];
	localStorage.setItem("detail",JSON.stringify(_detail));
	location.href = '/park/detail';
}
$(function() {
	var openid = localStorage.getItem("openid");
	$.ajax({
		url: '/park/data/getUserInfo?openid='+openid,
		type: 'post',
		dataType: 'json',
		success: function(res) {
			if (res.data!= null) {
				layer.open({
					type: 2
					, content: '加载中'
				});
				$.ajax({
					url: '/park/data/getRecords',
					type: 'post',
					data: 'carLicense=' + res.data.cph,
					dataType: 'json',
					success: function(ress) {
						layer.closeAll();
						if (ress.success == 'false' || false == ress.success) {
							layer.open({
								content: '未查到相关订单！',
								skin: 'msg',
								time: 2
								//2秒后自动关闭
							});
						} else {
							$('#data').show();
							for (var i = 0; i < ress.result.length; i++)  {
								ress.result[i].index = i;
								ress.result[i].num = parseInt(i) + 1;
								if (ress.result[i].outTime == null) {
									ress.result[i].outTime = '';
								}
							}
							_data = ress.result;
							new Vue({
								el: '#data',
								data: {
									datas: ress.result
								}
							})
						}
					}
				})
			}else{
				layer.open({
					content: '未关联车牌信息！',
					skin: 'msg',
					time: 2
					//2秒后自动关闭
				});
			}
		}
	})
})